﻿@{
    ViewBag.Title = "ContactListItem";
}

@{

    var item = Model;
}





<div class="box item span-4">

    <div>

       @item.UserName
    </div>
    <hr />
    <div>

        @if (item.Phones != null)
        {
            foreach (var p in item.Phones)
            {
                        
            <div>
                @p.PhoneNumber
            </div>
            }
        }
    </div>
    <hr />
    <div>
        @if (item.UserGroups != null)
        {
            foreach (var g in item.UserGroups)
            {
                       
            <div>
                <a  class="user_group_link" href="@Url.Action("ListContactsByUserGroup", "Contact", new { groupId = g.UserGroupId })">@g.GroupName</a>

            </div> 
            }
        }
    </div>
    <hr />
    <div>


        
        <a href="@Url.Action("Edit","Contact",  new { contactId = item.Id })" style="color:black">修改</a>
        <a onclick="DeleteContact('@Url.Action("Delete","Contact",  new { contactId = item.Id })')" style="color:black">删除</a>
    </div>
</div>
